Integrand size = 40, antiderivative size = 107 \[ \int \frac {\left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x)}{a+a \cos (c+d x)} \, dx=\frac {(3 B-2 C) \text {arctanh}(\sin (c+d x))}{2 a d}-\frac {2 (B-C) \tan (c+d x)}{a d}+\frac {(3 B-2 C) \sec (c+d x) \tan (c+d x)}{2 a d}-\frac {(B-C) \sec (c+d x) \tan (c+d x)}{d (a+a \cos (c+d x))} \]
1/2*(3*B-2*C)*arctanh(sin(d*x+c))/a/d-2*(B-C)*tan(d*x+c)/a/d+1/2*(3*B-2*C) *sec(d*x+c)*tan(d*x+c)/a/d-(B-C)*sec(d*x+c)*tan(d*x+c)/d/(a+a*cos(d*x+c))
Leaf count is larger than twice the leaf count of optimal. \(289\) vs. \(2(107)=214\).
Time = 5.85 (sec) , antiderivative size = 289, normalized size of antiderivative = 2.70 \[ \int \frac {\left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x)}{a+a \cos (c+d x)} \, dx=\frac {\cos \left (\frac {1}{2} (c+d x)\right ) \left (4 (-B+C) \sec \left (\frac {c}{2}\right ) \sin \left (\frac {d x}{2}\right )+\cos \left (\frac {1}{2} (c+d x)\right ) \left ((-6 B+4 C) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+6 B \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-4 C \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {B}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {B}{\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {4 (B-C) \sin (d x)}{\left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right )\right )}{2 a d (1+\cos (c+d x))} \]
(Cos[(c + d*x)/2]*(4*(-B + C)*Sec[c/2]*Sin[(d*x)/2] + Cos[(c + d*x)/2]*((- 6*B + 4*C)*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 6*B*Log[Cos[(c + d*x )/2] + Sin[(c + d*x)/2]] - 4*C*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] + B/(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])^2 - B/(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^2 - (4*(B - C)*Sin[d*x])/((Cos[c/2] - Sin[c/2])*(Cos[c/2] + Sin[ c/2])*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])*(Cos[(c + d*x)/2] + Sin[(c + d *x)/2])))))/(2*a*d*(1 + Cos[c + d*x]))
Time = 0.77 (sec) , antiderivative size = 100, normalized size of antiderivative = 0.93, number of steps used = 13, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {3042, 3508, 3042, 3457, 3042, 3227, 3042, 4254, 24, 4255, 3042, 4257}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\sec ^4(c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{a \cos (c+d x)+a} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2}{\sin \left (c+d x+\frac {\pi }{2}\right )^4 \left (a \sin \left (c+d x+\frac {\pi }{2}\right )+a\right )}dx\) |
\(\Big \downarrow \) 3508 |
\(\displaystyle \int \frac {\sec ^3(c+d x) (B+C \cos (c+d x))}{a \cos (c+d x)+a}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {B+C \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )^3 \left (a \sin \left (c+d x+\frac {\pi }{2}\right )+a\right )}dx\) |
\(\Big \downarrow \) 3457 |
\(\displaystyle \frac {\int (a (3 B-2 C)-2 a (B-C) \cos (c+d x)) \sec ^3(c+d x)dx}{a^2}-\frac {(B-C) \tan (c+d x) \sec (c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {a (3 B-2 C)-2 a (B-C) \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )^3}dx}{a^2}-\frac {(B-C) \tan (c+d x) \sec (c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 3227 |
\(\displaystyle \frac {a (3 B-2 C) \int \sec ^3(c+d x)dx-2 a (B-C) \int \sec ^2(c+d x)dx}{a^2}-\frac {(B-C) \tan (c+d x) \sec (c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a (3 B-2 C) \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx-2 a (B-C) \int \csc \left (c+d x+\frac {\pi }{2}\right )^2dx}{a^2}-\frac {(B-C) \tan (c+d x) \sec (c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 4254 |
\(\displaystyle \frac {\frac {2 a (B-C) \int 1d(-\tan (c+d x))}{d}+a (3 B-2 C) \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx}{a^2}-\frac {(B-C) \tan (c+d x) \sec (c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {a (3 B-2 C) \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx-\frac {2 a (B-C) \tan (c+d x)}{d}}{a^2}-\frac {(B-C) \tan (c+d x) \sec (c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 4255 |
\(\displaystyle \frac {a (3 B-2 C) \left (\frac {1}{2} \int \sec (c+d x)dx+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )-\frac {2 a (B-C) \tan (c+d x)}{d}}{a^2}-\frac {(B-C) \tan (c+d x) \sec (c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a (3 B-2 C) \left (\frac {1}{2} \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )-\frac {2 a (B-C) \tan (c+d x)}{d}}{a^2}-\frac {(B-C) \tan (c+d x) \sec (c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {a (3 B-2 C) \left (\frac {\text {arctanh}(\sin (c+d x))}{2 d}+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )-\frac {2 a (B-C) \tan (c+d x)}{d}}{a^2}-\frac {(B-C) \tan (c+d x) \sec (c+d x)}{d (a \cos (c+d x)+a)}\) |
-(((B - C)*Sec[c + d*x]*Tan[c + d*x])/(d*(a + a*Cos[c + d*x]))) + ((-2*a*( B - C)*Tan[c + d*x])/d + a*(3*B - 2*C)*(ArcTanh[Sin[c + d*x]]/(2*d) + (Sec [c + d*x]*Tan[c + d*x])/(2*d)))/a^2
3.3.59.3.1 Defintions of rubi rules used
Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x _)]), x_Symbol] :> Simp[c Int[(b*Sin[e + f*x])^m, x], x] + Simp[d/b Int [(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim p[b*(A*b - a*B)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^( n + 1)/(a*f*(2*m + 1)*(b*c - a*d))), x] + Simp[1/(a*(2*m + 1)*(b*c - a*d)) Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*Simp[B*(a*c*m + b *d*(n + 1)) + A*(b*c*(m + 1) - a*d*(2*m + n + 2)) + d*(A*b - a*B)*(m + n + 2)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ [b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ[m, -2^(-1)] && !GtQ[n, 0] && IntegerQ[2*m] && (IntegerQ[2*n] || EqQ[c, 0])
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_ .) + (f_.)*(x_)]^2), x_Symbol] :> Simp[1/b^2 Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*(b*B - a*C + b*C*Sin[e + f*x]), x], x] /; FreeQ [{a, b, c, d, e, f, A, B, C, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[A*b^2 - a*b*B + a^2*C, 0]
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1) Subst[Int[Exp andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* x]*((b*Csc[c + d*x])^(n - 1)/(d*(n - 1))), x] + Simp[b^2*((n - 2)/(n - 1)) Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && IntegerQ[2*n]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Time = 2.25 (sec) , antiderivative size = 126, normalized size of antiderivative = 1.18
method | result | size |
parallelrisch | \(\frac {-3 \left (1+\cos \left (2 d x +2 c \right )\right ) \left (B -\frac {2 C}{3}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+3 \left (1+\cos \left (2 d x +2 c \right )\right ) \left (B -\frac {2 C}{3}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-2 \left (\left (2 B -2 C \right ) \cos \left (2 d x +2 c \right )+\left (1+\cos \left (d x +c \right )\right ) \left (B -2 C \right )\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a d \left (1+\cos \left (2 d x +2 c \right )\right )}\) | \(126\) |
derivativedivides | \(\frac {-B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C -\frac {B}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {-\frac {3 B}{2}+C}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}+\left (\frac {3 B}{2}-C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\frac {B}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {-\frac {3 B}{2}+C}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1}+\left (-\frac {3 B}{2}+C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d a}\) | \(142\) |
default | \(\frac {-B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C -\frac {B}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {-\frac {3 B}{2}+C}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}+\left (\frac {3 B}{2}-C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\frac {B}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {-\frac {3 B}{2}+C}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1}+\left (-\frac {3 B}{2}+C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d a}\) | \(142\) |
risch | \(-\frac {i \left (3 B \,{\mathrm e}^{4 i \left (d x +c \right )}-2 C \,{\mathrm e}^{4 i \left (d x +c \right )}+3 B \,{\mathrm e}^{3 i \left (d x +c \right )}-2 C \,{\mathrm e}^{3 i \left (d x +c \right )}+5 B \,{\mathrm e}^{2 i \left (d x +c \right )}-6 C \,{\mathrm e}^{2 i \left (d x +c \right )}+B \,{\mathrm e}^{i \left (d x +c \right )}-2 C \,{\mathrm e}^{i \left (d x +c \right )}+4 B -4 C \right )}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {3 B \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 a d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{a d}+\frac {3 B \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 a d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{a d}\) | \(226\) |
norman | \(\frac {\frac {\left (2 B -3 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}+\frac {\left (4 B -3 C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {6 \left (B -C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {\left (B -C \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}+\frac {2 \left (2 B -C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {\left (3 B -C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {\left (3 B -2 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 a d}+\frac {\left (3 B -2 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 a d}\) | \(236\) |
1/2*(-3*(1+cos(2*d*x+2*c))*(B-2/3*C)*ln(tan(1/2*d*x+1/2*c)-1)+3*(1+cos(2*d *x+2*c))*(B-2/3*C)*ln(tan(1/2*d*x+1/2*c)+1)-2*((2*B-2*C)*cos(2*d*x+2*c)+(1 +cos(d*x+c))*(B-2*C))*tan(1/2*d*x+1/2*c))/a/d/(1+cos(2*d*x+2*c))
Time = 0.28 (sec) , antiderivative size = 156, normalized size of antiderivative = 1.46 \[ \int \frac {\left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x)}{a+a \cos (c+d x)} \, dx=\frac {{\left ({\left (3 \, B - 2 \, C\right )} \cos \left (d x + c\right )^{3} + {\left (3 \, B - 2 \, C\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left ({\left (3 \, B - 2 \, C\right )} \cos \left (d x + c\right )^{3} + {\left (3 \, B - 2 \, C\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (4 \, {\left (B - C\right )} \cos \left (d x + c\right )^{2} + {\left (B - 2 \, C\right )} \cos \left (d x + c\right ) - B\right )} \sin \left (d x + c\right )}{4 \, {\left (a d \cos \left (d x + c\right )^{3} + a d \cos \left (d x + c\right )^{2}\right )}} \]
1/4*(((3*B - 2*C)*cos(d*x + c)^3 + (3*B - 2*C)*cos(d*x + c)^2)*log(sin(d*x + c) + 1) - ((3*B - 2*C)*cos(d*x + c)^3 + (3*B - 2*C)*cos(d*x + c)^2)*log (-sin(d*x + c) + 1) - 2*(4*(B - C)*cos(d*x + c)^2 + (B - 2*C)*cos(d*x + c) - B)*sin(d*x + c))/(a*d*cos(d*x + c)^3 + a*d*cos(d*x + c)^2)
\[ \int \frac {\left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x)}{a+a \cos (c+d x)} \, dx=\frac {\int \frac {B \cos {\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}}{\cos {\left (c + d x \right )} + 1}\, dx + \int \frac {C \cos ^{2}{\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}}{\cos {\left (c + d x \right )} + 1}\, dx}{a} \]
(Integral(B*cos(c + d*x)*sec(c + d*x)**4/(cos(c + d*x) + 1), x) + Integral (C*cos(c + d*x)**2*sec(c + d*x)**4/(cos(c + d*x) + 1), x))/a
Leaf count of result is larger than twice the leaf count of optimal. 282 vs. \(2 (103) = 206\).
Time = 0.21 (sec) , antiderivative size = 282, normalized size of antiderivative = 2.64 \[ \int \frac {\left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x)}{a+a \cos (c+d x)} \, dx=-\frac {B {\left (\frac {2 \, {\left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {3 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a - \frac {2 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} - \frac {3 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a} + \frac {3 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a} + \frac {2 \, \sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} + 2 \, C {\left (\frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a} - \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a} - \frac {2 \, \sin \left (d x + c\right )}{{\left (a - \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )}}{2 \, d} \]
-1/2*(B*(2*(sin(d*x + c)/(cos(d*x + c) + 1) - 3*sin(d*x + c)^3/(cos(d*x + c) + 1)^3)/(a - 2*a*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + a*sin(d*x + c)^4 /(cos(d*x + c) + 1)^4) - 3*log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/a + 3* log(sin(d*x + c)/(cos(d*x + c) + 1) - 1)/a + 2*sin(d*x + c)/(a*(cos(d*x + c) + 1))) + 2*C*(log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/a - log(sin(d*x + c)/(cos(d*x + c) + 1) - 1)/a - 2*sin(d*x + c)/((a - a*sin(d*x + c)^2/(co s(d*x + c) + 1)^2)*(cos(d*x + c) + 1)) - sin(d*x + c)/(a*(cos(d*x + c) + 1 ))))/d
Time = 0.32 (sec) , antiderivative size = 157, normalized size of antiderivative = 1.47 \[ \int \frac {\left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x)}{a+a \cos (c+d x)} \, dx=\frac {\frac {{\left (3 \, B - 2 \, C\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a} - \frac {{\left (3 \, B - 2 \, C\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a} - \frac {2 \, {\left (B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{a} + \frac {2 \, {\left (3 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2} a}}{2 \, d} \]
1/2*((3*B - 2*C)*log(abs(tan(1/2*d*x + 1/2*c) + 1))/a - (3*B - 2*C)*log(ab s(tan(1/2*d*x + 1/2*c) - 1))/a - 2*(B*tan(1/2*d*x + 1/2*c) - C*tan(1/2*d*x + 1/2*c))/a + 2*(3*B*tan(1/2*d*x + 1/2*c)^3 - 2*C*tan(1/2*d*x + 1/2*c)^3 - B*tan(1/2*d*x + 1/2*c) + 2*C*tan(1/2*d*x + 1/2*c))/((tan(1/2*d*x + 1/2*c )^2 - 1)^2*a))/d
Time = 1.58 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.11 \[ \int \frac {\left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x)}{a+a \cos (c+d x)} \, dx=\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (3\,B-2\,C\right )-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (B-2\,C\right )}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a\right )}+\frac {2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (\frac {3\,B}{2}-C\right )}{a\,d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (B-C\right )}{a\,d} \]